{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "# from draw_cartoon import Animator\n",
    "from d2l import torch as d2l\n",
    "import torch\n",
    "from torch import nn"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 数据准备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_train, n_test, num_inputs, batch_size = 20, 100, 200, 5#输入的维度x1......x200，问题包括200个维度\n",
    "true_w, true_b = torch.ones((num_inputs, 1)) * 0.01, 0.05\n",
    "train_data = d2l.synthetic_data(true_w, true_b, n_train)#训练集样本数量为20\n",
    "train_iter = d2l.load_array(train_data, batch_size)\n",
    "test_data = d2l.synthetic_data(true_w, true_b, n_test)#测试集样本数量为100\n",
    "test_iter = d2l.load_array(test_data, batch_size, is_train=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([100, 200])\n",
      "torch.Size([100, 1])\n"
     ]
    }
   ],
   "source": [
    "tst_x_list=[]\n",
    "tst_y_list=[]\n",
    "for x,y in test_iter:\n",
    "    tst_x_list.append(x)\n",
    "    tst_y_list.append(y)\n",
    "tst_x=torch.cat(tst_x_list)\n",
    "tst_y=torch.cat(tst_y_list)\n",
    "print(tst_x.shape)\n",
    "print(tst_y.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 加入L2正则项"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "def train_concise(wd):\n",
    "    net=nn.Sequential(nn.Linear(num_inputs,1))#设置网络结构：输入100，输出1\n",
    "    for param in net.parameters():\n",
    "        param.data.normal_()#将所有可以学习的参数初始化为高斯分布\n",
    "    loss=nn.MSELoss(reduce='None')\n",
    "    num_epochs=200\n",
    "    lr=0.003\n",
    "    #训练器：L2正则，ps:偏置参数不需要衰减\n",
    "    train=torch.optim.SGD(\n",
    "        [{\"params\":net[0].weight,'weight_decay':wd},\n",
    "        {\"params\":net[0].bias}],\n",
    "        lr=lr\n",
    "    )\n",
    "    for epoch in range(num_epochs):\n",
    "        for X,y in train_iter:\n",
    "            train.zero_grad()\n",
    "            l=loss(net(X),y)\n",
    "            l.mean().backward()\n",
    "            train.step()\n",
    "        loss_temp=loss(net(tst_x),tst_y)\n",
    "        print(f\"第{int(epoch+1)}轮训练损失：\",loss_temp)\n",
    "        \n",
    "            \n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "不加入L2正则：基本损失值不变"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第1轮训练损失： tensor(102.9568, grad_fn=<MseLossBackward0>)\n",
      "第2轮训练损失： tensor(99.2762, grad_fn=<MseLossBackward0>)\n",
      "第3轮训练损失： tensor(97.1214, grad_fn=<MseLossBackward0>)\n",
      "第4轮训练损失： tensor(95.7949, grad_fn=<MseLossBackward0>)\n",
      "第5轮训练损失： tensor(94.9287, grad_fn=<MseLossBackward0>)\n",
      "第6轮训练损失： tensor(94.3263, grad_fn=<MseLossBackward0>)\n",
      "第7轮训练损失： tensor(93.8989, grad_fn=<MseLossBackward0>)\n",
      "第8轮训练损失： tensor(93.5629, grad_fn=<MseLossBackward0>)\n",
      "第9轮训练损失： tensor(93.3294, grad_fn=<MseLossBackward0>)\n",
      "第10轮训练损失： tensor(93.1165, grad_fn=<MseLossBackward0>)\n",
      "第11轮训练损失： tensor(92.9656, grad_fn=<MseLossBackward0>)\n",
      "第12轮训练损失： tensor(92.8249, grad_fn=<MseLossBackward0>)\n",
      "第13轮训练损失： tensor(92.7109, grad_fn=<MseLossBackward0>)\n",
      "第14轮训练损失： tensor(92.6190, grad_fn=<MseLossBackward0>)\n",
      "第15轮训练损失： tensor(92.5421, grad_fn=<MseLossBackward0>)\n",
      "第16轮训练损失： tensor(92.4703, grad_fn=<MseLossBackward0>)\n",
      "第17轮训练损失： tensor(92.4096, grad_fn=<MseLossBackward0>)\n",
      "第18轮训练损失： tensor(92.3613, grad_fn=<MseLossBackward0>)\n",
      "第19轮训练损失： tensor(92.3186, grad_fn=<MseLossBackward0>)\n",
      "第20轮训练损失： tensor(92.2847, grad_fn=<MseLossBackward0>)\n",
      "第21轮训练损失： tensor(92.2567, grad_fn=<MseLossBackward0>)\n",
      "第22轮训练损失： tensor(92.2318, grad_fn=<MseLossBackward0>)\n",
      "第23轮训练损失： tensor(92.2119, grad_fn=<MseLossBackward0>)\n",
      "第24轮训练损失： tensor(92.1949, grad_fn=<MseLossBackward0>)\n",
      "第25轮训练损失： tensor(92.1776, grad_fn=<MseLossBackward0>)\n",
      "第26轮训练损失： tensor(92.1649, grad_fn=<MseLossBackward0>)\n",
      "第27轮训练损失： tensor(92.1538, grad_fn=<MseLossBackward0>)\n",
      "第28轮训练损失： tensor(92.1446, grad_fn=<MseLossBackward0>)\n",
      "第29轮训练损失： tensor(92.1364, grad_fn=<MseLossBackward0>)\n",
      "第30轮训练损失： tensor(92.1286, grad_fn=<MseLossBackward0>)\n",
      "第31轮训练损失： tensor(92.1231, grad_fn=<MseLossBackward0>)\n",
      "第32轮训练损失： tensor(92.1185, grad_fn=<MseLossBackward0>)\n",
      "第33轮训练损失： tensor(92.1141, grad_fn=<MseLossBackward0>)\n",
      "第34轮训练损失： tensor(92.1105, grad_fn=<MseLossBackward0>)\n",
      "第35轮训练损失： tensor(92.1077, grad_fn=<MseLossBackward0>)\n",
      "第36轮训练损失： tensor(92.1049, grad_fn=<MseLossBackward0>)\n",
      "第37轮训练损失： tensor(92.1026, grad_fn=<MseLossBackward0>)\n",
      "第38轮训练损失： tensor(92.1009, grad_fn=<MseLossBackward0>)\n",
      "第39轮训练损失： tensor(92.0993, grad_fn=<MseLossBackward0>)\n",
      "第40轮训练损失： tensor(92.0978, grad_fn=<MseLossBackward0>)\n",
      "第41轮训练损失： tensor(92.0967, grad_fn=<MseLossBackward0>)\n",
      "第42轮训练损失： tensor(92.0960, grad_fn=<MseLossBackward0>)\n",
      "第43轮训练损失： tensor(92.0953, grad_fn=<MseLossBackward0>)\n",
      "第44轮训练损失： tensor(92.0946, grad_fn=<MseLossBackward0>)\n",
      "第45轮训练损失： tensor(92.0940, grad_fn=<MseLossBackward0>)\n",
      "第46轮训练损失： tensor(92.0935, grad_fn=<MseLossBackward0>)\n",
      "第47轮训练损失： tensor(92.0930, grad_fn=<MseLossBackward0>)\n",
      "第48轮训练损失： tensor(92.0926, grad_fn=<MseLossBackward0>)\n",
      "第49轮训练损失： tensor(92.0923, grad_fn=<MseLossBackward0>)\n",
      "第50轮训练损失： tensor(92.0920, grad_fn=<MseLossBackward0>)\n",
      "第51轮训练损失： tensor(92.0918, grad_fn=<MseLossBackward0>)\n",
      "第52轮训练损失： tensor(92.0916, grad_fn=<MseLossBackward0>)\n",
      "第53轮训练损失： tensor(92.0915, grad_fn=<MseLossBackward0>)\n",
      "第54轮训练损失： tensor(92.0913, grad_fn=<MseLossBackward0>)\n",
      "第55轮训练损失： tensor(92.0912, grad_fn=<MseLossBackward0>)\n",
      "第56轮训练损失： tensor(92.0911, grad_fn=<MseLossBackward0>)\n",
      "第57轮训练损失： tensor(92.0910, grad_fn=<MseLossBackward0>)\n",
      "第58轮训练损失： tensor(92.0909, grad_fn=<MseLossBackward0>)\n",
      "第59轮训练损失： tensor(92.0909, grad_fn=<MseLossBackward0>)\n",
      "第60轮训练损失： tensor(92.0908, grad_fn=<MseLossBackward0>)\n",
      "第61轮训练损失： tensor(92.0908, grad_fn=<MseLossBackward0>)\n",
      "第62轮训练损失： tensor(92.0907, grad_fn=<MseLossBackward0>)\n",
      "第63轮训练损失： tensor(92.0907, grad_fn=<MseLossBackward0>)\n",
      "第64轮训练损失： tensor(92.0907, grad_fn=<MseLossBackward0>)\n",
      "第65轮训练损失： tensor(92.0906, grad_fn=<MseLossBackward0>)\n",
      "第66轮训练损失： tensor(92.0906, grad_fn=<MseLossBackward0>)\n",
      "第67轮训练损失： tensor(92.0906, grad_fn=<MseLossBackward0>)\n",
      "第68轮训练损失： tensor(92.0906, grad_fn=<MseLossBackward0>)\n",
      "第69轮训练损失： tensor(92.0906, grad_fn=<MseLossBackward0>)\n",
      "第70轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第71轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第72轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第73轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第74轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第75轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第76轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第77轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第78轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第79轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第80轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第81轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第82轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第83轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第84轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第85轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第86轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第87轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第88轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第89轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第90轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第91轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第92轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第93轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第94轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第95轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第96轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第97轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第98轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第99轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第100轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第101轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第102轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第103轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第104轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第105轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第106轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第107轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第108轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第109轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第110轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第111轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第112轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第113轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第114轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第115轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第116轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第117轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第118轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第119轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第120轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第121轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第122轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第123轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第124轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第125轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第126轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第127轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第128轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第129轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第130轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第131轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第132轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第133轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第134轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第135轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第136轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第137轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第138轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第139轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第140轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第141轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第142轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第143轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第144轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第145轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第146轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第147轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第148轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第149轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第150轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第151轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第152轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第153轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第154轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第155轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第156轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第157轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第158轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第159轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第160轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第161轮训练损失： tensor(92.0905, grad_fn=<MseLossBackward0>)\n",
      "第162轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第163轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第164轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第165轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第166轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第167轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第168轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第169轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第170轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第171轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第172轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第173轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第174轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第175轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第176轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第177轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第178轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第179轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第180轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第181轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第182轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第183轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第184轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第185轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第186轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第187轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第188轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第189轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第190轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第191轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第192轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第193轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第194轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第195轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第196轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第197轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第198轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第199轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n",
      "第200轮训练损失： tensor(92.0904, grad_fn=<MseLossBackward0>)\n"
     ]
    }
   ],
   "source": [
    "train_concise(0)#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "加入L2正则：损失值会逐渐减少"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第1轮训练损失： tensor(189.7428, grad_fn=<MseLossBackward0>)\n",
      "第2轮训练损失： tensor(164.1969, grad_fn=<MseLossBackward0>)\n",
      "第3轮训练损失： tensor(143.5504, grad_fn=<MseLossBackward0>)\n",
      "第4轮训练损失： tensor(126.1256, grad_fn=<MseLossBackward0>)\n",
      "第5轮训练损失： tensor(111.1442, grad_fn=<MseLossBackward0>)\n",
      "第6轮训练损失： tensor(98.1171, grad_fn=<MseLossBackward0>)\n",
      "第7轮训练损失： tensor(86.6791, grad_fn=<MseLossBackward0>)\n",
      "第8轮训练损失： tensor(76.6208, grad_fn=<MseLossBackward0>)\n",
      "第9轮训练损失： tensor(67.7504, grad_fn=<MseLossBackward0>)\n",
      "第10轮训练损失： tensor(59.9270, grad_fn=<MseLossBackward0>)\n",
      "第11轮训练损失： tensor(53.0204, grad_fn=<MseLossBackward0>)\n",
      "第12轮训练损失： tensor(46.9197, grad_fn=<MseLossBackward0>)\n",
      "第13轮训练损失： tensor(41.5238, grad_fn=<MseLossBackward0>)\n",
      "第14轮训练损失： tensor(36.7555, grad_fn=<MseLossBackward0>)\n",
      "第15轮训练损失： tensor(32.5375, grad_fn=<MseLossBackward0>)\n",
      "第16轮训练损失： tensor(28.8069, grad_fn=<MseLossBackward0>)\n",
      "第17轮训练损失： tensor(25.5065, grad_fn=<MseLossBackward0>)\n",
      "第18轮训练损失： tensor(22.5868, grad_fn=<MseLossBackward0>)\n",
      "第19轮训练损失： tensor(20.0041, grad_fn=<MseLossBackward0>)\n",
      "第20轮训练损失： tensor(17.7198, grad_fn=<MseLossBackward0>)\n",
      "第21轮训练损失： tensor(15.6991, grad_fn=<MseLossBackward0>)\n",
      "第22轮训练损失： tensor(13.9108, grad_fn=<MseLossBackward0>)\n",
      "第23轮训练损失： tensor(12.3276, grad_fn=<MseLossBackward0>)\n",
      "第24轮训练损失： tensor(10.9273, grad_fn=<MseLossBackward0>)\n",
      "第25轮训练损失： tensor(9.6901, grad_fn=<MseLossBackward0>)\n",
      "第26轮训练损失： tensor(8.5939, grad_fn=<MseLossBackward0>)\n",
      "第27轮训练损失： tensor(7.6244, grad_fn=<MseLossBackward0>)\n",
      "第28轮训练损失： tensor(6.7684, grad_fn=<MseLossBackward0>)\n",
      "第29轮训练损失： tensor(6.0105, grad_fn=<MseLossBackward0>)\n",
      "第30轮训练损失： tensor(5.3407, grad_fn=<MseLossBackward0>)\n",
      "第31轮训练损失： tensor(4.7481, grad_fn=<MseLossBackward0>)\n",
      "第32轮训练损失： tensor(4.2238, grad_fn=<MseLossBackward0>)\n",
      "第33轮训练损失： tensor(3.7601, grad_fn=<MseLossBackward0>)\n",
      "第34轮训练损失： tensor(3.3503, grad_fn=<MseLossBackward0>)\n",
      "第35轮训练损失： tensor(2.9880, grad_fn=<MseLossBackward0>)\n",
      "第36轮训练损失： tensor(2.6681, grad_fn=<MseLossBackward0>)\n",
      "第37轮训练损失： tensor(2.3851, grad_fn=<MseLossBackward0>)\n",
      "第38轮训练损失： tensor(2.1348, grad_fn=<MseLossBackward0>)\n",
      "第39轮训练损失： tensor(1.9136, grad_fn=<MseLossBackward0>)\n",
      "第40轮训练损失： tensor(1.7183, grad_fn=<MseLossBackward0>)\n",
      "第41轮训练损失： tensor(1.5453, grad_fn=<MseLossBackward0>)\n",
      "第42轮训练损失： tensor(1.3930, grad_fn=<MseLossBackward0>)\n",
      "第43轮训练损失： tensor(1.2584, grad_fn=<MseLossBackward0>)\n",
      "第44轮训练损失： tensor(1.1396, grad_fn=<MseLossBackward0>)\n",
      "第45轮训练损失： tensor(1.0345, grad_fn=<MseLossBackward0>)\n",
      "第46轮训练损失： tensor(0.9415, grad_fn=<MseLossBackward0>)\n",
      "第47轮训练损失： tensor(0.8593, grad_fn=<MseLossBackward0>)\n",
      "第48轮训练损失： tensor(0.7871, grad_fn=<MseLossBackward0>)\n",
      "第49轮训练损失： tensor(0.7228, grad_fn=<MseLossBackward0>)\n",
      "第50轮训练损失： tensor(0.6665, grad_fn=<MseLossBackward0>)\n",
      "第51轮训练损失： tensor(0.6165, grad_fn=<MseLossBackward0>)\n",
      "第52轮训练损失： tensor(0.5724, grad_fn=<MseLossBackward0>)\n",
      "第53轮训练损失： tensor(0.5331, grad_fn=<MseLossBackward0>)\n",
      "第54轮训练损失： tensor(0.4984, grad_fn=<MseLossBackward0>)\n",
      "第55轮训练损失： tensor(0.4677, grad_fn=<MseLossBackward0>)\n",
      "第56轮训练损失： tensor(0.4405, grad_fn=<MseLossBackward0>)\n",
      "第57轮训练损失： tensor(0.4166, grad_fn=<MseLossBackward0>)\n",
      "第58轮训练损失： tensor(0.3956, grad_fn=<MseLossBackward0>)\n",
      "第59轮训练损失： tensor(0.3768, grad_fn=<MseLossBackward0>)\n",
      "第60轮训练损失： tensor(0.3600, grad_fn=<MseLossBackward0>)\n",
      "第61轮训练损失： tensor(0.3452, grad_fn=<MseLossBackward0>)\n",
      "第62轮训练损失： tensor(0.3319, grad_fn=<MseLossBackward0>)\n",
      "第63轮训练损失： tensor(0.3202, grad_fn=<MseLossBackward0>)\n",
      "第64轮训练损失： tensor(0.3097, grad_fn=<MseLossBackward0>)\n",
      "第65轮训练损失： tensor(0.3003, grad_fn=<MseLossBackward0>)\n",
      "第66轮训练损失： tensor(0.2920, grad_fn=<MseLossBackward0>)\n",
      "第67轮训练损失： tensor(0.2845, grad_fn=<MseLossBackward0>)\n",
      "第68轮训练损失： tensor(0.2778, grad_fn=<MseLossBackward0>)\n",
      "第69轮训练损失： tensor(0.2716, grad_fn=<MseLossBackward0>)\n",
      "第70轮训练损失： tensor(0.2660, grad_fn=<MseLossBackward0>)\n",
      "第71轮训练损失： tensor(0.2611, grad_fn=<MseLossBackward0>)\n",
      "第72轮训练损失： tensor(0.2563, grad_fn=<MseLossBackward0>)\n",
      "第73轮训练损失： tensor(0.2521, grad_fn=<MseLossBackward0>)\n",
      "第74轮训练损失： tensor(0.2484, grad_fn=<MseLossBackward0>)\n",
      "第75轮训练损失： tensor(0.2450, grad_fn=<MseLossBackward0>)\n",
      "第76轮训练损失： tensor(0.2418, grad_fn=<MseLossBackward0>)\n",
      "第77轮训练损失： tensor(0.2386, grad_fn=<MseLossBackward0>)\n",
      "第78轮训练损失： tensor(0.2356, grad_fn=<MseLossBackward0>)\n",
      "第79轮训练损失： tensor(0.2330, grad_fn=<MseLossBackward0>)\n",
      "第80轮训练损失： tensor(0.2304, grad_fn=<MseLossBackward0>)\n",
      "第81轮训练损失： tensor(0.2281, grad_fn=<MseLossBackward0>)\n",
      "第82轮训练损失： tensor(0.2258, grad_fn=<MseLossBackward0>)\n",
      "第83轮训练损失： tensor(0.2238, grad_fn=<MseLossBackward0>)\n",
      "第84轮训练损失： tensor(0.2218, grad_fn=<MseLossBackward0>)\n",
      "第85轮训练损失： tensor(0.2197, grad_fn=<MseLossBackward0>)\n",
      "第86轮训练损失： tensor(0.2178, grad_fn=<MseLossBackward0>)\n",
      "第87轮训练损失： tensor(0.2159, grad_fn=<MseLossBackward0>)\n",
      "第88轮训练损失： tensor(0.2142, grad_fn=<MseLossBackward0>)\n",
      "第89轮训练损失： tensor(0.2124, grad_fn=<MseLossBackward0>)\n",
      "第90轮训练损失： tensor(0.2107, grad_fn=<MseLossBackward0>)\n",
      "第91轮训练损失： tensor(0.2089, grad_fn=<MseLossBackward0>)\n",
      "第92轮训练损失： tensor(0.2073, grad_fn=<MseLossBackward0>)\n",
      "第93轮训练损失： tensor(0.2054, grad_fn=<MseLossBackward0>)\n",
      "第94轮训练损失： tensor(0.2039, grad_fn=<MseLossBackward0>)\n",
      "第95轮训练损失： tensor(0.2022, grad_fn=<MseLossBackward0>)\n",
      "第96轮训练损失： tensor(0.2007, grad_fn=<MseLossBackward0>)\n",
      "第97轮训练损失： tensor(0.1990, grad_fn=<MseLossBackward0>)\n",
      "第98轮训练损失： tensor(0.1974, grad_fn=<MseLossBackward0>)\n",
      "第99轮训练损失： tensor(0.1959, grad_fn=<MseLossBackward0>)\n",
      "第100轮训练损失： tensor(0.1943, grad_fn=<MseLossBackward0>)\n",
      "第101轮训练损失： tensor(0.1928, grad_fn=<MseLossBackward0>)\n",
      "第102轮训练损失： tensor(0.1914, grad_fn=<MseLossBackward0>)\n",
      "第103轮训练损失： tensor(0.1900, grad_fn=<MseLossBackward0>)\n",
      "第104轮训练损失： tensor(0.1885, grad_fn=<MseLossBackward0>)\n",
      "第105轮训练损失： tensor(0.1870, grad_fn=<MseLossBackward0>)\n",
      "第106轮训练损失： tensor(0.1857, grad_fn=<MseLossBackward0>)\n",
      "第107轮训练损失： tensor(0.1844, grad_fn=<MseLossBackward0>)\n",
      "第108轮训练损失： tensor(0.1829, grad_fn=<MseLossBackward0>)\n",
      "第109轮训练损失： tensor(0.1814, grad_fn=<MseLossBackward0>)\n",
      "第110轮训练损失： tensor(0.1801, grad_fn=<MseLossBackward0>)\n",
      "第111轮训练损失： tensor(0.1788, grad_fn=<MseLossBackward0>)\n",
      "第112轮训练损失： tensor(0.1774, grad_fn=<MseLossBackward0>)\n",
      "第113轮训练损失： tensor(0.1759, grad_fn=<MseLossBackward0>)\n",
      "第114轮训练损失： tensor(0.1746, grad_fn=<MseLossBackward0>)\n",
      "第115轮训练损失： tensor(0.1731, grad_fn=<MseLossBackward0>)\n",
      "第116轮训练损失： tensor(0.1720, grad_fn=<MseLossBackward0>)\n",
      "第117轮训练损失： tensor(0.1705, grad_fn=<MseLossBackward0>)\n",
      "第118轮训练损失： tensor(0.1692, grad_fn=<MseLossBackward0>)\n",
      "第119轮训练损失： tensor(0.1678, grad_fn=<MseLossBackward0>)\n",
      "第120轮训练损失： tensor(0.1665, grad_fn=<MseLossBackward0>)\n",
      "第121轮训练损失： tensor(0.1651, grad_fn=<MseLossBackward0>)\n",
      "第122轮训练损失： tensor(0.1637, grad_fn=<MseLossBackward0>)\n",
      "第123轮训练损失： tensor(0.1625, grad_fn=<MseLossBackward0>)\n",
      "第124轮训练损失： tensor(0.1611, grad_fn=<MseLossBackward0>)\n",
      "第125轮训练损失： tensor(0.1599, grad_fn=<MseLossBackward0>)\n",
      "第126轮训练损失： tensor(0.1587, grad_fn=<MseLossBackward0>)\n",
      "第127轮训练损失： tensor(0.1574, grad_fn=<MseLossBackward0>)\n",
      "第128轮训练损失： tensor(0.1561, grad_fn=<MseLossBackward0>)\n",
      "第129轮训练损失： tensor(0.1550, grad_fn=<MseLossBackward0>)\n",
      "第130轮训练损失： tensor(0.1538, grad_fn=<MseLossBackward0>)\n",
      "第131轮训练损失： tensor(0.1526, grad_fn=<MseLossBackward0>)\n",
      "第132轮训练损失： tensor(0.1514, grad_fn=<MseLossBackward0>)\n",
      "第133轮训练损失： tensor(0.1501, grad_fn=<MseLossBackward0>)\n",
      "第134轮训练损失： tensor(0.1490, grad_fn=<MseLossBackward0>)\n",
      "第135轮训练损失： tensor(0.1478, grad_fn=<MseLossBackward0>)\n",
      "第136轮训练损失： tensor(0.1466, grad_fn=<MseLossBackward0>)\n",
      "第137轮训练损失： tensor(0.1453, grad_fn=<MseLossBackward0>)\n",
      "第138轮训练损失： tensor(0.1441, grad_fn=<MseLossBackward0>)\n",
      "第139轮训练损失： tensor(0.1430, grad_fn=<MseLossBackward0>)\n",
      "第140轮训练损失： tensor(0.1418, grad_fn=<MseLossBackward0>)\n",
      "第141轮训练损失： tensor(0.1407, grad_fn=<MseLossBackward0>)\n",
      "第142轮训练损失： tensor(0.1397, grad_fn=<MseLossBackward0>)\n",
      "第143轮训练损失： tensor(0.1385, grad_fn=<MseLossBackward0>)\n",
      "第144轮训练损失： tensor(0.1373, grad_fn=<MseLossBackward0>)\n",
      "第145轮训练损失： tensor(0.1362, grad_fn=<MseLossBackward0>)\n",
      "第146轮训练损失： tensor(0.1352, grad_fn=<MseLossBackward0>)\n",
      "第147轮训练损失： tensor(0.1342, grad_fn=<MseLossBackward0>)\n",
      "第148轮训练损失： tensor(0.1331, grad_fn=<MseLossBackward0>)\n",
      "第149轮训练损失： tensor(0.1321, grad_fn=<MseLossBackward0>)\n",
      "第150轮训练损失： tensor(0.1311, grad_fn=<MseLossBackward0>)\n",
      "第151轮训练损失： tensor(0.1300, grad_fn=<MseLossBackward0>)\n",
      "第152轮训练损失： tensor(0.1289, grad_fn=<MseLossBackward0>)\n",
      "第153轮训练损失： tensor(0.1278, grad_fn=<MseLossBackward0>)\n",
      "第154轮训练损失： tensor(0.1268, grad_fn=<MseLossBackward0>)\n",
      "第155轮训练损失： tensor(0.1258, grad_fn=<MseLossBackward0>)\n",
      "第156轮训练损失： tensor(0.1249, grad_fn=<MseLossBackward0>)\n",
      "第157轮训练损失： tensor(0.1240, grad_fn=<MseLossBackward0>)\n",
      "第158轮训练损失： tensor(0.1230, grad_fn=<MseLossBackward0>)\n",
      "第159轮训练损失： tensor(0.1220, grad_fn=<MseLossBackward0>)\n",
      "第160轮训练损失： tensor(0.1211, grad_fn=<MseLossBackward0>)\n",
      "第161轮训练损失： tensor(0.1202, grad_fn=<MseLossBackward0>)\n",
      "第162轮训练损失： tensor(0.1192, grad_fn=<MseLossBackward0>)\n",
      "第163轮训练损失： tensor(0.1183, grad_fn=<MseLossBackward0>)\n",
      "第164轮训练损失： tensor(0.1174, grad_fn=<MseLossBackward0>)\n",
      "第165轮训练损失： tensor(0.1164, grad_fn=<MseLossBackward0>)\n",
      "第166轮训练损失： tensor(0.1155, grad_fn=<MseLossBackward0>)\n",
      "第167轮训练损失： tensor(0.1146, grad_fn=<MseLossBackward0>)\n",
      "第168轮训练损失： tensor(0.1137, grad_fn=<MseLossBackward0>)\n",
      "第169轮训练损失： tensor(0.1128, grad_fn=<MseLossBackward0>)\n",
      "第170轮训练损失： tensor(0.1120, grad_fn=<MseLossBackward0>)\n",
      "第171轮训练损失： tensor(0.1111, grad_fn=<MseLossBackward0>)\n",
      "第172轮训练损失： tensor(0.1102, grad_fn=<MseLossBackward0>)\n",
      "第173轮训练损失： tensor(0.1093, grad_fn=<MseLossBackward0>)\n",
      "第174轮训练损失： tensor(0.1084, grad_fn=<MseLossBackward0>)\n",
      "第175轮训练损失： tensor(0.1076, grad_fn=<MseLossBackward0>)\n",
      "第176轮训练损失： tensor(0.1068, grad_fn=<MseLossBackward0>)\n",
      "第177轮训练损失： tensor(0.1061, grad_fn=<MseLossBackward0>)\n",
      "第178轮训练损失： tensor(0.1053, grad_fn=<MseLossBackward0>)\n",
      "第179轮训练损失： tensor(0.1045, grad_fn=<MseLossBackward0>)\n",
      "第180轮训练损失： tensor(0.1037, grad_fn=<MseLossBackward0>)\n",
      "第181轮训练损失： tensor(0.1029, grad_fn=<MseLossBackward0>)\n",
      "第182轮训练损失： tensor(0.1020, grad_fn=<MseLossBackward0>)\n",
      "第183轮训练损失： tensor(0.1013, grad_fn=<MseLossBackward0>)\n",
      "第184轮训练损失： tensor(0.1005, grad_fn=<MseLossBackward0>)\n",
      "第185轮训练损失： tensor(0.0998, grad_fn=<MseLossBackward0>)\n",
      "第186轮训练损失： tensor(0.0990, grad_fn=<MseLossBackward0>)\n",
      "第187轮训练损失： tensor(0.0983, grad_fn=<MseLossBackward0>)\n",
      "第188轮训练损失： tensor(0.0976, grad_fn=<MseLossBackward0>)\n",
      "第189轮训练损失： tensor(0.0968, grad_fn=<MseLossBackward0>)\n",
      "第190轮训练损失： tensor(0.0960, grad_fn=<MseLossBackward0>)\n",
      "第191轮训练损失： tensor(0.0953, grad_fn=<MseLossBackward0>)\n",
      "第192轮训练损失： tensor(0.0947, grad_fn=<MseLossBackward0>)\n",
      "第193轮训练损失： tensor(0.0939, grad_fn=<MseLossBackward0>)\n",
      "第194轮训练损失： tensor(0.0932, grad_fn=<MseLossBackward0>)\n",
      "第195轮训练损失： tensor(0.0925, grad_fn=<MseLossBackward0>)\n",
      "第196轮训练损失： tensor(0.0918, grad_fn=<MseLossBackward0>)\n",
      "第197轮训练损失： tensor(0.0912, grad_fn=<MseLossBackward0>)\n",
      "第198轮训练损失： tensor(0.0904, grad_fn=<MseLossBackward0>)\n",
      "第199轮训练损失： tensor(0.0898, grad_fn=<MseLossBackward0>)\n",
      "第200轮训练损失： tensor(0.0891, grad_fn=<MseLossBackward0>)\n"
     ]
    }
   ],
   "source": [
    "train_concise(5)#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画图版本：看着更直观hhhhhh"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "def train_concise2(wd):\n",
    "    net=nn.Sequential(nn.Linear(num_inputs,1))#设置网络结构：输入100，输出1\n",
    "    for param in net.parameters():\n",
    "        param.data.normal_()#将所有可以学习的参数初始化为高斯分布\n",
    "    loss=nn.MSELoss(reduce='None')\n",
    "    num_epochs=1000\n",
    "    lr=0.001\n",
    "    #训练器：L2正则，ps:偏置参数不需要衰减\n",
    "    train=torch.optim.SGD(\n",
    "        [{\"params\":net[0].weight,'weight_decay':wd},\n",
    "        {\"params\":net[0].bias}],\n",
    "        lr=lr\n",
    "    )\n",
    "    animator = d2l.Animator(xlabel='epochs', ylabel='loss', yscale='log',\n",
    "    xlim=[5, num_epochs], legend=['train', 'test'])\n",
    "    for epoch in range(num_epochs):\n",
    "        for X,y in train_iter:\n",
    "            train.zero_grad()\n",
    "            l=loss(net(X),y)\n",
    "            l.mean().backward()\n",
    "            train.step()\n",
    "    #画图\n",
    "    \n",
    "        if (epoch + 1) % 5 == 0:\n",
    "            animator.add(epoch + 1,\n",
    "        (d2l.evaluate_loss(net, train_iter, loss),\n",
    "        d2l.evaluate_loss(net, test_iter, loss)))\n",
    "        \n",
    "            \n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"266.603125pt\" height=\"183.35625pt\" viewBox=\"0 0 266.603125 183.35625\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2025-01-09T23:45:44.102595</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.7.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 183.35625 \n",
       "L 266.603125 183.35625 \n",
       "L 266.603125 -0 \n",
       "L 0 -0 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 51.378125 145.8 \n",
       "L 246.678125 145.8 \n",
       "L 246.678125 7.2 \n",
       "L 51.378125 7.2 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path d=\"M 89.652999 145.8 \n",
       "L 89.652999 7.2 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path id=\"m285feb4693\" d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m285feb4693\" x=\"89.652999\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 200 -->\n",
       "      <g transform=\"translate(80.109249 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path d=\"M 128.909281 145.8 \n",
       "L 128.909281 7.2 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m285feb4693\" x=\"128.909281\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 400 -->\n",
       "      <g transform=\"translate(119.365531 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path d=\"M 168.165562 145.8 \n",
       "L 168.165562 7.2 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m285feb4693\" x=\"168.165562\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 600 -->\n",
       "      <g transform=\"translate(158.621812 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-36\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path d=\"M 207.421844 145.8 \n",
       "L 207.421844 7.2 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m285feb4693\" x=\"207.421844\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 800 -->\n",
       "      <g transform=\"translate(197.878094 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-38\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path d=\"M 246.678125 145.8 \n",
       "L 246.678125 7.2 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m285feb4693\" x=\"246.678125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 1000 -->\n",
       "      <g transform=\"translate(233.953125 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-31\" d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- epochs -->\n",
       "     <g transform=\"translate(131.195312 174.076563) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-70\" d=\"M 1159 525 \n",
       "L 1159 -1331 \n",
       "L 581 -1331 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "z\n",
       "M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \n",
       "L 3122 2828 \n",
       "Q 2878 2963 2633 3030 \n",
       "Q 2388 3097 2138 3097 \n",
       "Q 1578 3097 1268 2742 \n",
       "Q 959 2388 959 1747 \n",
       "Q 959 1106 1268 751 \n",
       "Q 1578 397 2138 397 \n",
       "Q 2388 397 2633 464 \n",
       "Q 2878 531 3122 666 \n",
       "L 3122 134 \n",
       "Q 2881 22 2623 -34 \n",
       "Q 2366 -91 2075 -91 \n",
       "Q 1284 -91 818 406 \n",
       "Q 353 903 353 1747 \n",
       "Q 353 2603 823 3093 \n",
       "Q 1294 3584 2113 3584 \n",
       "Q 2378 3584 2631 3529 \n",
       "Q 2884 3475 3122 3366 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-68\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \n",
       "L 2834 2853 \n",
       "Q 2591 2978 2328 3040 \n",
       "Q 2066 3103 1784 3103 \n",
       "Q 1356 3103 1142 2972 \n",
       "Q 928 2841 928 2578 \n",
       "Q 928 2378 1081 2264 \n",
       "Q 1234 2150 1697 2047 \n",
       "L 1894 2003 \n",
       "Q 2506 1872 2764 1633 \n",
       "Q 3022 1394 3022 966 \n",
       "Q 3022 478 2636 193 \n",
       "Q 2250 -91 1575 -91 \n",
       "Q 1294 -91 989 -36 \n",
       "Q 684 19 347 128 \n",
       "L 347 722 \n",
       "Q 666 556 975 473 \n",
       "Q 1284 391 1588 391 \n",
       "Q 1994 391 2212 530 \n",
       "Q 2431 669 2431 922 \n",
       "Q 2431 1156 2273 1281 \n",
       "Q 2116 1406 1581 1522 \n",
       "L 1381 1569 \n",
       "Q 847 1681 609 1914 \n",
       "Q 372 2147 372 2553 \n",
       "Q 372 3047 722 3315 \n",
       "Q 1072 3584 1716 3584 \n",
       "Q 2034 3584 2315 3537 \n",
       "Q 2597 3491 2834 3397 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-70\" x=\"61.523438\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-63\" x=\"186.181641\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-68\" x=\"241.162109\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"304.541016\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path d=\"M 51.378125 118.471918 \n",
       "L 246.678125 118.471918 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <defs>\n",
       "       <path id=\"m98d52eae21\" d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m98d52eae21\" x=\"51.378125\" y=\"118.471918\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- $\\mathdefault{10^{-9}}$ -->\n",
       "      <g transform=\"translate(20.878125 122.271137) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-2212\" d=\"M 678 2272 \n",
       "L 4684 2272 \n",
       "L 4684 1741 \n",
       "L 678 1741 \n",
       "L 678 2272 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-39\" d=\"M 703 97 \n",
       "L 703 672 \n",
       "Q 941 559 1184 500 \n",
       "Q 1428 441 1663 441 \n",
       "Q 2288 441 2617 861 \n",
       "Q 2947 1281 2994 2138 \n",
       "Q 2813 1869 2534 1725 \n",
       "Q 2256 1581 1919 1581 \n",
       "Q 1219 1581 811 2004 \n",
       "Q 403 2428 403 3163 \n",
       "Q 403 3881 828 4315 \n",
       "Q 1253 4750 1959 4750 \n",
       "Q 2769 4750 3195 4129 \n",
       "Q 3622 3509 3622 2328 \n",
       "Q 3622 1225 3098 567 \n",
       "Q 2575 -91 1691 -91 \n",
       "Q 1453 -91 1209 -44 \n",
       "Q 966 3 703 97 \n",
       "z\n",
       "M 1959 2075 \n",
       "Q 2384 2075 2632 2365 \n",
       "Q 2881 2656 2881 3163 \n",
       "Q 2881 3666 2632 3958 \n",
       "Q 2384 4250 1959 4250 \n",
       "Q 1534 4250 1286 3958 \n",
       "Q 1038 3666 1038 3163 \n",
       "Q 1038 2656 1286 2365 \n",
       "Q 1534 2075 1959 2075 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-39\" transform=\"translate(186.855469 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path d=\"M 51.378125 90.431135 \n",
       "L 246.678125 90.431135 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m98d52eae21\" x=\"51.378125\" y=\"90.431135\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- $\\mathdefault{10^{-6}}$ -->\n",
       "      <g transform=\"translate(20.878125 94.230353) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-36\" transform=\"translate(186.855469 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path d=\"M 51.378125 62.390351 \n",
       "L 246.678125 62.390351 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m98d52eae21\" x=\"51.378125\" y=\"62.390351\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- $\\mathdefault{10^{-3}}$ -->\n",
       "      <g transform=\"translate(20.878125 66.18957) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" transform=\"translate(186.855469 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path d=\"M 51.378125 34.349568 \n",
       "L 246.678125 34.349568 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m98d52eae21\" x=\"51.378125\" y=\"34.349568\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- $\\mathdefault{10^{0}}$ -->\n",
       "      <g transform=\"translate(26.778125 38.148787) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_11\">\n",
       "     <!-- loss -->\n",
       "     <g transform=\"translate(14.798437 86.157813) rotate(-90) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"27.783203\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"88.964844\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"141.064453\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_19\">\n",
       "    <path d=\"M 51.378125 15.690508 \n",
       "L 53.340939 23.290777 \n",
       "L 55.303753 30.146437 \n",
       "L 57.266567 36.384223 \n",
       "L 60.210788 44.877066 \n",
       "L 64.136416 55.259721 \n",
       "L 69.043452 67.465054 \n",
       "L 73.950487 79.115908 \n",
       "L 79.838929 92.461673 \n",
       "L 84.745964 103.026306 \n",
       "L 89.652999 113.018036 \n",
       "L 92.59722 118.386914 \n",
       "L 93.578628 119.974613 \n",
       "L 94.560035 121.115681 \n",
       "L 96.522849 123.648098 \n",
       "L 97.504256 124.342298 \n",
       "L 98.485663 125.498199 \n",
       "L 99.46707 126.205127 \n",
       "L 102.411291 127.711931 \n",
       "L 103.392698 128.040042 \n",
       "L 105.355512 129.037876 \n",
       "L 106.336919 129.157882 \n",
       "L 107.318326 129.490707 \n",
       "L 108.299733 129.468326 \n",
       "L 109.28114 130.134433 \n",
       "L 111.243954 130.64855 \n",
       "L 113.206768 131.275352 \n",
       "L 114.188175 131.845678 \n",
       "L 115.169582 131.692516 \n",
       "L 117.132396 131.816547 \n",
       "L 118.113803 132.14663 \n",
       "L 121.058024 132.710561 \n",
       "L 122.039432 132.933257 \n",
       "L 123.020839 132.86775 \n",
       "L 124.002246 133.114623 \n",
       "L 124.983653 133.206398 \n",
       "L 125.96506 133.519995 \n",
       "L 126.946467 133.620567 \n",
       "L 127.927874 133.485935 \n",
       "L 129.890688 134.125867 \n",
       "L 130.872095 133.987521 \n",
       "L 131.853502 134.185846 \n",
       "L 132.834909 134.012721 \n",
       "L 133.816316 134.277554 \n",
       "L 134.797723 134.330357 \n",
       "L 135.77913 134.254188 \n",
       "L 136.760537 134.406081 \n",
       "L 137.741944 134.389855 \n",
       "L 138.723351 134.539377 \n",
       "L 139.704758 134.82985 \n",
       "L 140.686165 135.52651 \n",
       "L 141.667572 135.416497 \n",
       "L 142.648979 135.028145 \n",
       "L 143.630386 134.987845 \n",
       "L 144.611793 135.22871 \n",
       "L 145.5932 135.732726 \n",
       "L 146.574607 136.030039 \n",
       "L 147.556014 136.008781 \n",
       "L 148.537421 136.237252 \n",
       "L 152.46305 136.424888 \n",
       "L 153.444457 136.631691 \n",
       "L 156.388678 136.729456 \n",
       "L 158.351492 137.019255 \n",
       "L 162.27712 136.930255 \n",
       "L 164.239934 137.516617 \n",
       "L 165.221341 137.61485 \n",
       "L 166.202748 137.400945 \n",
       "L 171.109783 137.477225 \n",
       "L 172.09119 137.874603 \n",
       "L 173.072597 137.892761 \n",
       "L 174.054004 137.683199 \n",
       "L 175.035411 137.783793 \n",
       "L 176.016818 137.492944 \n",
       "L 176.998226 137.391672 \n",
       "L 180.923854 137.564899 \n",
       "L 181.905261 137.793503 \n",
       "L 187.793703 138.035663 \n",
       "L 188.77511 138.424172 \n",
       "L 189.756517 138.484392 \n",
       "L 190.737924 138.400645 \n",
       "L 191.719331 138.506002 \n",
       "L 192.700738 138.39076 \n",
       "L 193.682145 138.489259 \n",
       "L 194.663552 138.423852 \n",
       "L 195.644959 138.60673 \n",
       "L 196.626366 138.427295 \n",
       "L 197.607773 138.673085 \n",
       "L 199.570587 138.596305 \n",
       "L 200.551994 138.674287 \n",
       "L 201.533401 138.887668 \n",
       "L 208.403251 138.326766 \n",
       "L 209.384658 138.368831 \n",
       "L 210.366065 138.276874 \n",
       "L 215.2731 139.110038 \n",
       "L 218.217321 139.17694 \n",
       "L 219.198728 139.333043 \n",
       "L 220.180135 139.118895 \n",
       "L 222.142949 139.056264 \n",
       "L 225.08717 139.5 \n",
       "L 226.068577 138.936841 \n",
       "L 227.049984 139.250986 \n",
       "L 228.031391 139.3618 \n",
       "L 229.012798 139.187487 \n",
       "L 232.938427 139.30229 \n",
       "L 233.919834 139.472796 \n",
       "L 234.901241 139.322418 \n",
       "L 237.845462 139.265837 \n",
       "L 238.826869 139.478146 \n",
       "L 239.808276 139.490273 \n",
       "L 240.789683 139.300338 \n",
       "L 241.77109 138.787847 \n",
       "L 242.752497 138.932548 \n",
       "L 243.733904 139.303328 \n",
       "L 246.678125 139.209318 \n",
       "L 246.678125 139.209318 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_20\">\n",
       "    <path d=\"M 51.378125 13.5 \n",
       "L 53.340939 13.660983 \n",
       "L 61.192195 13.672579 \n",
       "L 204.477622 13.669148 \n",
       "L 246.678125 13.669148 \n",
       "L 246.678125 13.669148 \n",
       "\" clip-path=\"url(#p17cb8214a7)\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #bf00bf; stroke-width: 1.5\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 51.378125 145.8 \n",
       "L 51.378125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 246.678125 145.8 \n",
       "L 246.678125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 51.378125 145.8 \n",
       "L 246.678125 145.8 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 51.378125 7.2 \n",
       "L 246.678125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 184.403125 92.678125 \n",
       "L 239.678125 92.678125 \n",
       "Q 241.678125 92.678125 241.678125 90.678125 \n",
       "L 241.678125 62.321875 \n",
       "Q 241.678125 60.321875 239.678125 60.321875 \n",
       "L 184.403125 60.321875 \n",
       "Q 182.403125 60.321875 182.403125 62.321875 \n",
       "L 182.403125 90.678125 \n",
       "Q 182.403125 92.678125 184.403125 92.678125 \n",
       "z\n",
       "\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_21\">\n",
       "     <path d=\"M 186.403125 68.420313 \n",
       "L 196.403125 68.420313 \n",
       "L 206.403125 68.420313 \n",
       "\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_12\">\n",
       "     <!-- train -->\n",
       "     <g transform=\"translate(214.403125 71.920313) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"39.208984\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"80.322266\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"141.601562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"169.384766\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_22\">\n",
       "     <path d=\"M 186.403125 83.098438 \n",
       "L 196.403125 83.098438 \n",
       "L 206.403125 83.098438 \n",
       "\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #bf00bf; stroke-width: 1.5\"/>\n",
       "    </g>\n",
       "    <g id=\"text_13\">\n",
       "     <!-- test -->\n",
       "     <g transform=\"translate(214.403125 86.598438) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"39.208984\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"100.732422\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"152.832031\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p17cb8214a7\">\n",
       "   <rect x=\"51.378125\" y=\"7.2\" width=\"195.3\" height=\"138.6\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 350x250 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "train_concise2(0)#过拟合情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"266.603125pt\" height=\"183.35625pt\" viewBox=\"0 0 266.603125 183.35625\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2025-01-09T23:46:05.420961</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.7.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 183.35625 \n",
       "L 266.603125 183.35625 \n",
       "L 266.603125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 51.378125 145.8 \n",
       "L 246.678125 145.8 \n",
       "L 246.678125 7.2 \n",
       "L 51.378125 7.2 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path d=\"M 89.652999 145.8 \n",
       "L 89.652999 7.2 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path id=\"mff257ae484\" d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#mff257ae484\" x=\"89.652999\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 200 -->\n",
       "      <g transform=\"translate(80.109249 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path d=\"M 128.909281 145.8 \n",
       "L 128.909281 7.2 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mff257ae484\" x=\"128.909281\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 400 -->\n",
       "      <g transform=\"translate(119.365531 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path d=\"M 168.165562 145.8 \n",
       "L 168.165562 7.2 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mff257ae484\" x=\"168.165562\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 600 -->\n",
       "      <g transform=\"translate(158.621812 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-36\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path d=\"M 207.421844 145.8 \n",
       "L 207.421844 7.2 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mff257ae484\" x=\"207.421844\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 800 -->\n",
       "      <g transform=\"translate(197.878094 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-38\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path d=\"M 246.678125 145.8 \n",
       "L 246.678125 7.2 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mff257ae484\" x=\"246.678125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 1000 -->\n",
       "      <g transform=\"translate(233.953125 160.398438) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-31\" d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- epochs -->\n",
       "     <g transform=\"translate(131.195312 174.076563) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-70\" d=\"M 1159 525 \n",
       "L 1159 -1331 \n",
       "L 581 -1331 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "z\n",
       "M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \n",
       "L 3122 2828 \n",
       "Q 2878 2963 2633 3030 \n",
       "Q 2388 3097 2138 3097 \n",
       "Q 1578 3097 1268 2742 \n",
       "Q 959 2388 959 1747 \n",
       "Q 959 1106 1268 751 \n",
       "Q 1578 397 2138 397 \n",
       "Q 2388 397 2633 464 \n",
       "Q 2878 531 3122 666 \n",
       "L 3122 134 \n",
       "Q 2881 22 2623 -34 \n",
       "Q 2366 -91 2075 -91 \n",
       "Q 1284 -91 818 406 \n",
       "Q 353 903 353 1747 \n",
       "Q 353 2603 823 3093 \n",
       "Q 1294 3584 2113 3584 \n",
       "Q 2378 3584 2631 3529 \n",
       "Q 2884 3475 3122 3366 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-68\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \n",
       "L 2834 2853 \n",
       "Q 2591 2978 2328 3040 \n",
       "Q 2066 3103 1784 3103 \n",
       "Q 1356 3103 1142 2972 \n",
       "Q 928 2841 928 2578 \n",
       "Q 928 2378 1081 2264 \n",
       "Q 1234 2150 1697 2047 \n",
       "L 1894 2003 \n",
       "Q 2506 1872 2764 1633 \n",
       "Q 3022 1394 3022 966 \n",
       "Q 3022 478 2636 193 \n",
       "Q 2250 -91 1575 -91 \n",
       "Q 1294 -91 989 -36 \n",
       "Q 684 19 347 128 \n",
       "L 347 722 \n",
       "Q 666 556 975 473 \n",
       "Q 1284 391 1588 391 \n",
       "Q 1994 391 2212 530 \n",
       "Q 2431 669 2431 922 \n",
       "Q 2431 1156 2273 1281 \n",
       "Q 2116 1406 1581 1522 \n",
       "L 1381 1569 \n",
       "Q 847 1681 609 1914 \n",
       "Q 372 2147 372 2553 \n",
       "Q 372 3047 722 3315 \n",
       "Q 1072 3584 1716 3584 \n",
       "Q 2034 3584 2315 3537 \n",
       "Q 2597 3491 2834 3397 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-70\" x=\"61.523438\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-63\" x=\"186.181641\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-68\" x=\"241.162109\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"304.541016\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path d=\"M 51.378125 107.329341 \n",
       "L 246.678125 107.329341 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <defs>\n",
       "       <path id=\"m1211ddaa1b\" d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m1211ddaa1b\" x=\"51.378125\" y=\"107.329341\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- $\\mathdefault{10^{-2}}$ -->\n",
       "      <g transform=\"translate(20.878125 111.12856) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-2212\" d=\"M 678 2272 \n",
       "L 4684 2272 \n",
       "L 4684 1741 \n",
       "L 678 1741 \n",
       "L 678 2272 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(186.855469 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path d=\"M 51.378125 62.311234 \n",
       "L 246.678125 62.311234 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m1211ddaa1b\" x=\"51.378125\" y=\"62.311234\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- $\\mathdefault{10^{0}}$ -->\n",
       "      <g transform=\"translate(26.778125 66.110453) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path d=\"M 51.378125 17.293128 \n",
       "L 246.678125 17.293128 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m1211ddaa1b\" x=\"51.378125\" y=\"17.293128\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- $\\mathdefault{10^{2}}$ -->\n",
       "      <g transform=\"translate(26.778125 21.092346) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(128.203125 39.046875) scale(0.7)\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_10\">\n",
       "     <!-- loss -->\n",
       "     <g transform=\"translate(14.798437 86.157813) rotate(-90) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"27.783203\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"88.964844\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"141.064453\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_17\">\n",
       "    <path d=\"M 51.378125 22.036076 \n",
       "L 54.322346 49.576586 \n",
       "L 57.266567 75.116347 \n",
       "L 60.210788 98.903171 \n",
       "L 62.173602 113.132552 \n",
       "L 63.155009 119.182907 \n",
       "L 64.136416 124.122892 \n",
       "L 65.117823 127.718267 \n",
       "L 66.099231 129.994574 \n",
       "L 67.080638 131.277149 \n",
       "L 68.062045 131.98892 \n",
       "L 69.043452 132.330175 \n",
       "L 71.006266 132.598429 \n",
       "L 119.09521 135.126731 \n",
       "L 121.058024 135.122563 \n",
       "L 123.020839 135.287051 \n",
       "L 127.927874 135.441849 \n",
       "L 129.890688 135.580183 \n",
       "L 137.741944 135.964345 \n",
       "L 141.667572 136.106253 \n",
       "L 144.611793 136.260674 \n",
       "L 146.574607 136.273515 \n",
       "L 149.518829 136.444812 \n",
       "L 158.351492 136.819413 \n",
       "L 160.314306 136.895098 \n",
       "L 163.258527 136.984766 \n",
       "L 169.146969 137.154372 \n",
       "L 173.072597 137.303749 \n",
       "L 191.719331 137.969003 \n",
       "L 194.663552 138.017587 \n",
       "L 211.347472 138.601192 \n",
       "L 246.678125 139.5 \n",
       "L 246.678125 139.5 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_18\">\n",
       "    <path d=\"M 51.378125 13.5 \n",
       "L 53.340939 16.135328 \n",
       "L 59.229381 23.196881 \n",
       "L 89.652999 59.331676 \n",
       "L 97.504256 68.317215 \n",
       "L 103.392698 74.713633 \n",
       "L 107.318326 78.695362 \n",
       "L 111.243954 82.350284 \n",
       "L 114.188175 84.82162 \n",
       "L 117.132396 87.023512 \n",
       "L 120.076617 88.936345 \n",
       "L 123.020839 90.551931 \n",
       "L 125.96506 91.883738 \n",
       "L 128.909281 92.956508 \n",
       "L 131.853502 93.807442 \n",
       "L 135.77913 94.663757 \n",
       "L 139.704758 95.281161 \n",
       "L 144.611793 95.828109 \n",
       "L 151.481643 96.339731 \n",
       "L 161.295713 96.821804 \n",
       "L 178.96104 97.434708 \n",
       "L 206.440437 98.174611 \n",
       "L 242.752497 98.917194 \n",
       "L 246.678125 98.98281 \n",
       "L 246.678125 98.98281 \n",
       "\" clip-path=\"url(#pbe43e64a1f)\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #bf00bf; stroke-width: 1.5\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 51.378125 145.8 \n",
       "L 51.378125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 246.678125 145.8 \n",
       "L 246.678125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 51.378125 145.8 \n",
       "L 246.678125 145.8 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 51.378125 7.2 \n",
       "L 246.678125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 184.403125 44.55625 \n",
       "L 239.678125 44.55625 \n",
       "Q 241.678125 44.55625 241.678125 42.55625 \n",
       "L 241.678125 14.2 \n",
       "Q 241.678125 12.2 239.678125 12.2 \n",
       "L 184.403125 12.2 \n",
       "Q 182.403125 12.2 182.403125 14.2 \n",
       "L 182.403125 42.55625 \n",
       "Q 182.403125 44.55625 184.403125 44.55625 \n",
       "z\n",
       "\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_19\">\n",
       "     <path d=\"M 186.403125 20.298438 \n",
       "L 196.403125 20.298438 \n",
       "L 206.403125 20.298438 \n",
       "\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_11\">\n",
       "     <!-- train -->\n",
       "     <g transform=\"translate(214.403125 23.798438) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"39.208984\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"80.322266\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"141.601562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"169.384766\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_20\">\n",
       "     <path d=\"M 186.403125 34.976562 \n",
       "L 196.403125 34.976562 \n",
       "L 206.403125 34.976562 \n",
       "\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #bf00bf; stroke-width: 1.5\"/>\n",
       "    </g>\n",
       "    <g id=\"text_12\">\n",
       "     <!-- test -->\n",
       "     <g transform=\"translate(214.403125 38.476562) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"39.208984\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"100.732422\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"152.832031\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pbe43e64a1f\">\n",
       "   <rect x=\"51.378125\" y=\"7.2\" width=\"195.3\" height=\"138.6\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 350x250 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "train_concise2(3)#使用L2范数后，过拟合情况得到缓解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
